<template>
  <div>
    <div class="main-content">
      <div class="detail-container">
        <div class="detail-title">详情信息</div>
        <div class="detail-content">
          <div class="detail-richtext">
            <div class="detail-richtext-title">{{obj.title}}</div>
            <div class="detail-richtext-subtitle">
              <span style="padding-left: 10px">发布时间：{{obj.time}}</span>
            </div>
            <div class="detail-richtext-content w-e-text" v-html="obj.content"></div>
          </div>

        </div>

      </div>
    </div>
  </div>
</template>


<script>
import request from "@/utils/request";

export default {

  data() {
    let objId = this.$route.query.id
    return {
      user: JSON.parse(localStorage.getItem('user') || {}),
      objId: objId,
      obj: {},
      title:'',
    }
  },
  mounted() {
    this.load();
    this.loadComment();
  },
  // methods：本页面所有的点击事件或者其他函数定义区
  methods: {
    load() {
      request.get('/introduce/' + this.objId).then(res => {
        this.obj = res.data
      })
    },

    loadComment() {
      request.get('/comment/' + this.objId).then(res => {
        if (res.code === '0') {
          this.comments = res.data
        } else {
          this.$notify.error(res.msg)
        }
      })
    },
  }
}
</script>